package hardwareToSQL.pruningAlgorithm;


public class PruningCoef implements Pruning{

	private double coef;
	private double lastValue;
	private double _value;
	
	public PruningCoef(double coef){
		
		this.coef = coef;
		lastValue = 0;
	}
	
	public void insertValue(double value){

		if(Math.abs(lastValue-value)/value <= coef){
			_value = value;
			lastValue = value;
		} else {
			lastValue = value;
		}
		
	}
	
	public double returnValue(){
		return _value;
	}
	
}
